import os
import sys

# 获取当前文件的父目录
father_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

sys.path.append(father_path)
import redis
from conf.conf import *


def update_token(data_str):
    token_queue = redis.Redis(host=redis_host, port=redis_port, db=redis_db)
    token_queue.delete('token_cookie')
    token_queue.sadd('token_cookie', data_str)


_str = '947559400***noticeLoginFlag=1; pgv_pvi=1555042304; ptui_loginuin=1730116525; RK=X1JNboKsMB; ptcz=95670db8dbc13f4bf7c2cc31a9f0c637f1b26d09729475790845cfaf9c8ecdae; ua_id=D2xJHnz4m6nTQdbIAAAAALelQYf7_rXdQ7yrYmUmMBo=; noticeLoginFlag=1; pgv_pvid=8061819320; tvfe_boss_uuid=5bb2ec20df231b2f; mm_lang=zh_CN; sd_userid=69541571980894598; sd_cookie_crttime=1571980894598; o_cookie=1730116525; pac_uid=1_1730116525; pgv_si=s5420370944; cert=k6bUk85QD1ahbEfZQiCZasTh9ALN0AKt; openid2ticket_ogpNNw8RggIyIadZKgtNjuw97R9Y=vgaBpEFx4+DtqMULSEAhXfxip0MmpPR9TtKqhBpZ3lk=; rewardsn=; wxtokenkey=777; wxuin=744989361; lang=zh_CN; devicetype=android-28; version=2700073a; pass_ticket=VAxlXykATTqH4aWyvUycqpHAcKXc3WdOBRn7creE/eQey3eqpgOTBOhbMe5y9; wap_sid2=CLHFnuMCElwyaG04UUluemFIeDluamswdy1ULWRJcFNjSEhHSEQteWFIc2w5UE5BV3c5MVVQeTRsVE5JakY5VGxkM1kteEtySUxPaEotaFU2d1R4VHN2cnB1ZkRHZ2tFQUFBfjCGy//tBTgMQJRO; pgv_info=ssid=s7428124480; openid2ticket_ojVCrwfPwIbJhcfH1wQxyoNkdAkE=ocoYGxOHLnwiLvAk6t70tQEcy8CAFnwAmYaaHyHUmio=; uuid=1acd726e834a2f1a795bcc6a0ec51a00; data_bizuin=3276641154; bizuin=3588004850; data_ticket=PNS7nPqKa0/vigFATcUTdCbJkSOGV+BYmgiexr0cILTxt9hcc5UGmWihdHxKiO/+; slave_sid=VnZKRmU3OGpVaTlYUE5HRHBvQXB0ejdVRjZnZmdST3lNMGFPMlFSWjZ6ZHZ2VnY1TmhmQnpvMkFHOENTRnlydW1WcWhiUzJNOWRYX3d1ME91U1U4ZG0wNVhOa193V2YzdUxoMG9QcjV0R2U0MTVGZlV0eFlEMVdndDJqTllnc1hCV2VaZzVGWUp3T2ZHRXVD; slave_user=gh_3c021a4b8e86; xid=6a3087226914de319f71da43f0ac0be9'
update_token(data_str=_str)
